package MyMybatis.CRUD;

import MyMybatis.entity.Student;

import org.apache.ibatis.session.SqlSession;

public class Main {
    public static void main(String[] args) {
        try(SqlSession sqlSession = CRUDUtil.getSession(true)){
            CRUDMapper crud = sqlSession.getMapper(CRUDMapper.class);
            crud.selectStudent().forEach(System.out::println);
            System.out.println(crud.getStudentBySid(1940618806));
            System.out.println(crud.insertStudent(new Student().setSid(1940618808).setName("java好难学").setGender("男")));
//            System.out.println(crud.updateStudent(1940618808,"java好难学","女"));  update的不对，还不会
            System.out.println(crud.getStudentBySid(1940618808));
            crud.deleteStudent(1940618808);

        }
    }
}
